package Tets;
public class GoodTest {
    public static void main(String[] args) {
        //1.创建一个数组
        Goods[]arr=new Goods[3];
        //2.创建3个商品对象
        Goods g1=new Goods("001","p40",5999.0,100);
        Goods g2=new Goods("002","p50",6999.0,200);
        Goods g3=new Goods("003","p60",7999.0,500);
        //3. 把商品添加到数组中
        arr[0]=g1;
        arr[1]=g2;
        arr[2]=g3;
        for (int i = 0; i < arr.length; i++) {
            Goods g=arr[i];
            System.out.println(g.getId()+","+g.getName()+","+g.getPrice()+","+g.getCount());
        }
    }
}
